import request from '@/utils/request'

/**
 * 采购入库分页查询
 * @param {*} form
 * @param {*} pageSize
 * @param {*} currentPage
 */
export function dataList(form, pageSize, currentPage) {
  const data = {
    param: form,
    pageSize: pageSize,
    pageNo: currentPage
  }
  return request.post('/sq/purchase/page', data)
}
/**
 * 编辑-采购入库修改
 * @param {*} options
 */
export function updateData(options) {
  return request.put('/sq/purchase/wh/save', options)
}
/*
 * save
 * @param {*} id
 */
export function save(form={}) {
  return request.put(`/sq/purchase/wh/save`,form)
}

/**
 * 根据id查询采购入库详情
 * @param {*} options
 */
export function details(id) {
  return request.get('/sq/purchase/wh/' + id)
}


/**
 * 采购退货
 * @param {*} id
 */
export function saleReturn(form={}) {
  return request.post('/sq/purchase/wh/saleReturn',form)
}

/**
 * 采购入库
 * @param {*} id
 */
export function okInBound(id) {
  return request.get(`/sq/purchase/wh/okInBound/${id}`)
}


/**
 * 采购入库
 * @param {*} id
 */
export function uploadPdi({id,pdi}) {
  return request.get(`/sq/purchase/wh/uploadPdi/${id}?pdi=${pdi}`)
}
